<template>
	<BaseContainer>
		<aplid-base-crud ref="crud" class="w-100" v-bind="theConfig" :paramsObj="paramsObj">
			<template v-slot:importDialog="{ row, show }">
				<ImportForm @refresh="handleRefresh" :api="theConfig.api" :key="show" :nowRowData="row"></ImportForm>
			</template>
		</aplid-base-crud>
	</BaseContainer>
</template>

<script setup lang="ts">
import { baseConfig } from './config'
import ImportForm from './components/ImportForm/index.vue'
import { editConfig } from '@/views/datacenter/comprehensiveQueries/utils/index'
// import TabForm from './components/TabForm/index.vue'
type Props = {
	isWithAuth?:any,
	isComprehensiveQueries?:boolean
}
let props = withDefaults(defineProps<Props>(),{
	isWithAuth:undefined,
	isComprehensiveQueries:false
})
let paramsObj = ref({
	code:2023,
	isWithAuth:props.isWithAuth
})
let theConfig :any= ref({})
if(baseConfig){
  let defaultConfig = JSON.parse(JSON.stringify(baseConfig))
  if(props.isComprehensiveQueries){
    theConfig.value = editConfig(defaultConfig)
  }else{
    theConfig.value = baseConfig
  }
}

const crud = ref()

const dialogVisible = ref(false)
const handleRefresh = (query, visible = false) => {
	dialogVisible.value = visible
	nextTick(() => {
		crud.value.refreshChange(query)
	})
}
</script>

<style scoped></style>
